import React from 'react';
import ReactDOM from 'react-dom/client';
import { ConfigProvider } from 'antd';
// 由于 antd 组件的默认文案是英文，所以需要修改为中文
import 'dayjs/locale/zh-cn';
import zhCN from 'antd/locale/zh_CN';
import 'antd/dist/reset.css';
import '@/assets/scss/index.scss';
import App from './App';

window.addEventListener('unhandledrejection', function (event) {
    if (event) {
        event.preventDefault();
        if (process.env.NODE_ENV === 'development') {
            console.info(event.reason);
        }
    }
});

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
    <ConfigProvider locale={zhCN} theme={{
        token: {
          colorPrimary: '#00b96b',
        },
    }}>
        <App />
    </ConfigProvider>
);
